Egypt <- read.csv("http://www.statpower.net/Content/312/Lecture Slides/Egypt.csv") source("http://www.statpower.net/Content/312/R Stuff/Steiger R Library Functions.txt") source("http://www.statpower.net/Content/312/R Stuff/ClassifyCode.r") names(Egypt) #Group 1 = circa 4000 BC #Group 2 = circa 3300 BC #mb: maximum breadth of the skull. #bh: basibregmatic height of the skull. #bl: basialiveolar length of the skull. #nh: nasal heights of the skull. x <- as.matrix(Egypt[,2:5]) Group <- as.matrix(Egypt[,1]) DiscriminantAnalysis(x,Group) Classify(x,Group) Egypt$Group <- Egypt$Group-1 fit <- glm(Group ~ .,data=Egypt,family=binomial) summary(fit) Class <- predict(fit,type="response")>.5 table(Egypt$Group,Class)